#ifndef RIGIDBODYENGINE_H
#define RIGIDBODYENGINE_H

#include <iostream>
#include <map>
#include "rigidbody.h"
class RigidBodyEngine
{



public:
    std::list<RigidBody*> bodies;

    Math::Real timestep;

    Math::Real gravity;

    bool pause;

    virtual ~RigidBodyEngine()
    {
        std::list<RigidBody*>::iterator it = bodies.begin();
        for(;it!=bodies.end();++it)
        {
            delete(*it);
        }
        bodies.clear();
    }

    virtual void removeRigidBody(RigidBody* b) = 0;

    virtual void simulate() = 0;

    virtual void* createBox(Math::Vector3 &size, Math::Vector3 &position, Math::Quaternion &rotation) = 0;

    virtual void* createSphere(Math::Real &radius, Math::Vector3 &position) = 0;

    virtual void* createMesh(TriMesh *mesh, Math::Vector3 &position, Math::Quaternion &rotation) = 0;

    virtual void setStatic(RigidBody *b, bool set) = 0;

    virtual void addBody(RigidBody* b) = 0;

    virtual void stop() = 0;

    virtual void setTimestep(Math::Real timestep) = 0;

    virtual void setGravity(Math::Real gravity) = 0;

    virtual void translateBody(RigidBody* b, Math::Vector3 &t) = 0;


};

#endif // RIGIDBODYENGINE_H
